package com.bloody.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class CharacterMenu extends PlayerWindowInteraction implements View.OnClickListener{
	
	private Button mButton;
	private Button mButton2;
	private Button mButton3;
	private Button mButton4;
	private Button mButton5;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.characterselected);
        Bundle bundle = this.getIntent().getExtras();
        
        if (bundle.getBoolean("move")){
	        mButton = (Button)findViewById(R.id.button);
	        mButton.setVisibility(1);
	        mButton.setOnClickListener(this);
        }
        mButton2 = (Button)findViewById(R.id.button2);
        mButton2.setOnClickListener(this);
        mButton3 = (Button)findViewById(R.id.button3);
        mButton3.setOnClickListener(this);
        mButton4 = (Button)findViewById(R.id.button4);
        mButton4.setOnClickListener(this);
        mButton5 = (Button)findViewById(R.id.button5);
        mButton5.setOnClickListener(this);
    }
	
	@Override
	public void onClick(View view) {
		if (view == mButton) {
			mButton.setVisibility(0);
			Bundle bundle = new Bundle();
			Intent mIntent = new Intent();
			mIntent.putExtras(bundle);
			setResult(BloodyCrusadeGame.RES_MOVE, mIntent);
			finish();
		}
		else if (view == mButton2) {
			Bundle bundle = new Bundle();
			Intent mIntent = new Intent();
			mIntent.putExtras(bundle);
			setResult(BloodyCrusadeGame.RES_ATTACK, mIntent);
			finish();
		}
		else if (view == mButton3) {
			Bundle bundle = new Bundle();
			Intent mIntent = new Intent();
			mIntent.putExtras(bundle);
			setResult(BloodyCrusadeGame.RES_ABILITY, mIntent);
			finish();
		}
		else if (view == mButton4) {
			Bundle bundle = new Bundle();
			Intent mIntent = new Intent();
			mIntent.putExtras(bundle);
			setResult(BloodyCrusadeGame.RES_PASS, mIntent);
			finish();
		}
		else if (view == mButton5) {
			Bundle bundle = new Bundle();
			Intent mIntent = new Intent();
			mIntent.putExtras(bundle);
			setResult(BloodyCrusadeGame.RES_BACK, mIntent);
			finish();
		}
	}
}


